package com.hbnu.system.controller;

import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.entity.Work_press;
import com.hbnu.system.service.IWorkPressSerivce;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/workpress")
@Api(tags = "著作出版社模块")
public class WorkPressController {
    @Autowired private IWorkPressSerivce workPressSerivce;

    @ApiOperation("著作出版社单个查看")
    @GetMapping("/getWorkPressByID")
    public Rest<Work_press> getWorkPressByID(String ID){
        Work_press work_press = workPressSerivce.checkOneWorkPress(ID);
        return Rest.success(work_press);
    }

    @ApiOperation("著作出版社总查看")
    @GetMapping("/getWorkPresses")
    public Rest<List<Work_press>> getWorkPresses(){
        List<Work_press> work_presses = workPressSerivce.checkWrokPresses();
        return Rest.success(work_presses);
    }
}
